import React from "react";

// useRoutes的作用就是将routes数组，转成标签
import { Link, useRoutes } from "react-router-dom";
import routes from "./router/index";

const App = () => {
  const element = useRoutes(routes);
  return (
    <>
      <h2>app项目</h2>
      <ul>
        <li>
          <Link to="/home">首页</Link>
        </li>
        <li>
          <Link to="/about">关于页</Link>
        </li>
      </ul>

      <hr />

      {element}

      {/* <Routes>
        <Route path="/home" element={<Home />}></Route>
        <Route path="/about" element={<About />}></Route>
      </Routes> */}
    </>
  );
};

export default App;
